package api;

import android.content.Context;

import java.lang.ref.SoftReference;


public abstract class API_TX_Manager {

    public static String clazz = "api.TXManagerHolder";

    private static SoftReference<API_TX_Manager> sf;

    public synchronized static API_TX_Manager getInstance() {

        if (sf == null || sf.get() == null) {
            Object o = null;
            try {
                o = Class.forName(clazz).newInstance();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (InstantiationException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            }
            if (o != null) {
                sf = new SoftReference<>((API_TX_Manager) o);
                return (API_TX_Manager) o;
            }
        }
        return sf == null ? null : sf.get();
    }

    public abstract void init(Context cxt,String adposid);
}